<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script  type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/1.10.0/jquery.js"></script>
    <script>
        $(function () {
            alert($("div").has("span"));

            
        })
    </script>
</head>
<body>
    <div>div1</div>
    <div>div2</div>
    <div>div3<span>div中的span</span></div>


</body>
</html>